﻿package mortal.game.net.command.mount
{
    import Framework.MQ.*;
    import Message.Public.*;
    import extend.language.*;
    import mortal.game.manager.*;
    import mortal.game.manager.msgTip.*;
    import mortal.game.mvc.*;
    import mortal.game.net.broadCast.*;
    import mortal.mvc.core.*;

    public class MountUpdateCommand extends BroadCastCall
    {

        public function MountUpdateCommand(param1:Object)
        {
            super(param1);
            return;
        }// end function

        override public function call(param1:MessageBlock) : void
        {
            var _loc_3:SAttributeUpdate = null;
            var _loc_4:int = 0;
            var _loc_2:* = param1.messageBase as SSeqAttributeUpdate;
            for each (_loc_3 in _loc_2.updates)
            {
                
                switch(_loc_3.attribute.__value)
                {
                    case EEntityAttribute._EAttributeMountBless:
                    {
                        _loc_4 = _loc_3.value - _cache.mount.mountData.sPublicMount.bless;
                        if (_loc_4 > 0)
                        {
                            MsgManager.showMouseMsg(Language.getStringByParam(20515, _loc_4, MsgRollTipsType.msgRollTips2));
                        }
                        if (_cache.mount.mountData.tMountConfig.blessClear && _cache.mount.mountData.sPublicMount.bless == 0 && _loc_3.value > 0)
                        {
                            _cache.mount.mountData.sPublicMount.lastAdvanceSuccessDt = new Date(ClockManager.instance.nowDate.time + ClockManager.instance.DayTime);
                        }
                        _cache.mount.mountData.sPublicMount.bless = _loc_3.value;
                        NetDispatcher.dispatchCmd(ServerCommand.MountBlessUpdata, null);
                        break;
                    }
                    case EEntityAttribute._EAttributeMount:
                    {
                        break;
                    }
                    case EEntityAttribute._EAttributeMountCurrentTalentNum:
                    {
                        break;
                    }
                    case EEntityAttribute._EAttributeMountTotalTalentNum:
                    {
                        _cache.mount.mountData.sPublicMount.totalTalentNum = _loc_3.value;
                        NetDispatcher.dispatchCmd(ServerCommand.MountAttrUpdate, null);
                        break;
                    }
                    case EEntityAttribute._EAttributeMountCurrentGrowthNum:
                    {
                        break;
                    }
                    case EEntityAttribute._EAttributeMountTotalGrowthNum:
                    {
                        _cache.mount.mountData.sPublicMount.totalGrowthNum = _loc_3.value;
                        NetDispatcher.dispatchCmd(ServerCommand.MountAttrUpdate, null);
                        break;
                    }
                    case EEntityAttribute._EAtrributeMountReturn:
                    {
                        _cache.mount.mountData.sPublicMount.advanceReturn = _loc_3.value;
                        NetDispatcher.dispatchCmd(ServerCommand.MountActivityWinUpdate, null);
                        break;
                    }
                    case EEntityAttribute._EAttributeMountAdvancedNum:
                    {
                        _cache.mount.mountData.sPublicMount.advanceNum = _loc_3.value;
                        break;
                    }
                    case EEntityAttribute._EAttributeMountShapeCardStatus:
                    {
                        _cache.mount.mountData.sPublicMount.shapeCardStatus = _loc_3.value;
                        NetDispatcher.dispatchCmd(ServerCommand.MountShapeCardStat, _loc_3.value);
                        break;
                    }
                    case EEntityAttribute._EAttributeMountShape:
                    {
                        _cache.mount.mountData.sPublicMount.sharpId = _loc_3.value;
                        NetDispatcher.dispatchCmd(ServerCommand.MountSharpSuccess, null);
                        break;
                    }
                    default:
                    {
                        break;
                    }
                }
            }
            return;
        }// end function

    }
}
